const mockCategories = [ //如果子级没有banner 那么scroll默认应该是true
    {
        name: '美食餐饮',
        id: 1,
        childCats: [{ id: 101, name: '火锅', count: 100 }, { id: 102, name: '川菜' }, { id: 103, name: '西餐' }],
        where: { cat: 1, type: 0, order: 0 },
        datas: [
            { id: 201, title: '豪华火锅套餐', image: 'https://picsum.photos/seed/food201/300/300.jpg', price: 258, originalPrice: 368, discount: 7.0, memberBack: 8, promoteReward: 15, store: { name: '川味火锅店' }, count: 328, promotionCount: 128, memberReturn: 20, commissionRate: 5, commissionAmount: 30 },
            { id: 202, title: '精致西餐双人餐', image: 'https://picsum.photos/seed/food202/300/300.jpg', price: 398, originalPrice: 528, discount: 7.5, memberBack: 12, promoteReward: 25, store: { name: '蓝调西餐厅' }, count: 186, promotionCount: 89, memberReturn: 20, commissionRate: 5, commissionAmount: 45 },
            { id: 203, title: '川菜经典套餐', image: 'https://picsum.photos/seed/food203/300/300.jpg', price: 228, originalPrice: 318, discount: 7.2, memberBack: 6, promoteReward: 12, store: { name: '蜀香园' }, count: 276, promotionCount: 156, memberReturn: 20, commissionRate: 5, commissionAmount: 25 }
        ],
        banner: [
            { id: 3, image: 'https://picsum.photos/seed/food1/750/300.jpg', url: '/pages/tuan/today', title: '美食团购季' },
            { id: 4, image: 'https://picsum.photos/seed/food2/750/300.jpg', url: '/pages/coupon/activity', title: '美食优惠券' }
        ]
    },
    {
        name: '酒店住宿',
        id: 2,
        childCats: [{ id: 201, name: '经济型', count: 100 }, { id: 202, name: '商务型' }, { id: 203, name: '豪华型' }],
        where: { cat: 2, type: 0, order: 0 },
        datas: [
            { id: 301, title: '商务大床房', image: 'https://picsum.photos/seed/hotel301/300/300.jpg', price: 328, originalPrice: 458, discount: 7.2, memberBack: 10, promoteReward: 20, store: { name: '城市商务酒店' }, count: 145, promotionCount: 67, memberReturn: 20, commissionRate: 5, commissionAmount: 35 },
            { id: 302, title: '豪华套房', image: 'https://picsum.photos/seed/hotel302/300/300.jpg', price: 888, originalPrice: 1288, discount: 6.9, memberBack: 25, promoteReward: 50, store: { name: '五星级国际酒店' }, count: 89, promotionCount: 45, memberReturn: 20, commissionRate: 5, commissionAmount: 95 },
            { id: 303, title: '经济双床房', image: 'https://picsum.photos/seed/hotel303/300/300.jpg', price: 198, originalPrice: 268, discount: 7.4, memberBack: 5, promoteReward: 10, store: { name: '便捷连锁酒店' }, count: 234, promotionCount: 112, memberReturn: 20, commissionRate: 5, commissionAmount: 20 }
        ],
        banner: [
            { id: 5, image: 'https://picsum.photos/seed/hotel1/750/300.jpg', url: '/pages/goods/list?cat=2', title: '酒店特惠' },
            { id: 6, image: 'https://picsum.photos/seed/hotel2/750/300.jpg', url: '/pages/tuan/activity', title: '周末住宿套餐' }
        ]
    },
    {
        name: '休闲娱乐',
        id: 3,
        childCats: [{ id: 301, name: '电影', count: 100 }, { id: 302, name: 'KTV' }, { id: 303, name: '密室逃脱' }],
        where: { cat: 3, type: 0, order: 0 },
        datas: [
            { id: 401, title: 'IMAX电影票', image: 'https://picsum.photos/seed/ent401/300/300.jpg', price: 58, originalPrice: 80, discount: 7.3, memberBack: 2, promoteReward: 5, store: { name: '万达影城' }, count: 520, promotionCount: 289, memberReturn: 20, commissionRate: 5, commissionAmount: 8 },
            { id: 402, title: 'KTV欢唱套餐', image: 'https://picsum.photos/seed/ent402/300/300.jpg', price: 298, originalPrice: 468, discount: 6.4, memberBack: 8, promoteReward: 15, store: { name: '星光KTV' }, count: 189, promotionCount: 98, memberReturn: 20, commissionRate: 5, commissionAmount: 35 },
            { id: 403, title: '密室逃脱体验', image: 'https://picsum.photos/seed/ent403/300/300.jpg', price: 128, originalPrice: 168, discount: 7.6, memberBack: 3, promoteReward: 8, store: { name: '逃脱空间' }, count: 210, promotionCount: 105, memberReturn: 20, commissionRate: 5, commissionAmount: 15 }
        ],
        banner: [
            { id: 7, image: 'https://picsum.photos/seed/entertain1/750/300.jpg', url: '/pages/goods/list?cat=3', title: '娱乐好去处' },
            { id: 8, image: 'https://picsum.photos/seed/entertain2/750/300.jpg', url: '/pages/coupon/detail?id=5', title: '电影优惠券' }
        ]
    },
    {
        name: '生活服务',
        id: 4,
        childCats: [{ id: 401, name: '家政', count: 100 }, { id: 402, name: '洗衣' }, { id: 403, name: '维修' }],
        where: { cat: 4, type: 0, order: 0 },
        datas: [
            { id: 501, title: '家庭保洁套餐', image: 'https://picsum.photos/seed/service501/300/300.jpg', price: 198, originalPrice: 268, discount: 7.4, memberBack: 6, promoteReward: 12, store: { name: '洁净家政' }, count: 167, promotionCount: 89, memberReturn: 20, commissionRate: 5, commissionAmount: 25 },
            { id: 502, title: '洗衣特惠卡', image: 'https://picsum.photos/seed/service502/300/300.jpg', price: 128, originalPrice: 188, discount: 6.8, memberBack: 3, promoteReward: 8, store: { name: '快捷洗衣店' }, count: 290, promotionCount: 145, memberReturn: 20, commissionRate: 5, commissionAmount: 15 },
            { id: 503, title: '家电维修服务', image: 'https://picsum.photos/seed/service503/300/300.jpg', price: 88, originalPrice: 120, discount: 7.3, memberBack: 2, promoteReward: 5, store: { name: '万能维修' }, count: 320, promotionCount: 189, memberReturn: 20, commissionRate: 5, commissionAmount: 10 }
        ],
        banner: [
            { id: 9, image: 'https://picsum.photos/seed/service1/750/300.jpg', url: '/pages/goods/list?cat=4', title: '生活便民服务' },
            { id: 10, image: 'https://picsum.photos/seed/service2/750/300.jpg', url: '/pages/distribution/products', title: '服务优惠套餐' }
        ]
    },
    {
        name: '教育培训',
        id: 5,
        childCats: [{ id: 501, name: '少儿教育', count: 100 }, { id: 502, name: '职业培训' }, { id: 503, name: '语言培训' }],
        where: { cat: 5, type: 0, order: 0 },
        datas: [
            { id: 601, title: '少儿编程课程', image: 'https://picsum.photos/seed/edu601/300/300.jpg', price: 999, originalPrice: 1299, discount: 7.7, memberBack: 30, promoteReward: 60, store: { name: '未来编程' }, count: 134, promotionCount: 67, memberReturn: 20, commissionRate: 5, commissionAmount: 120 },
            { id: 602, name: '英语培训课程', image: 'https://picsum.photos/seed/edu602/300/300.jpg', price: 1580, originalPrice: 1980, discount: 8.0, memberBack: 50, promoteReward: 100, store: { name: '环球英语' }, count: 98, promotionCount: 45, memberReturn: 20, commissionRate: 5, commissionAmount: 180 },
            { id: 603, title: '职场技能提升', image: 'https://picsum.photos/seed/edu603/300/300.jpg', price: 1280, originalPrice: 1680, discount: 7.6, memberBack: 40, promoteReward: 80, store: { name: '职场学院' }, count: 176, promotionCount: 89, memberReturn: 20, commissionRate: 5, commissionAmount: 150 }
        ],
        banner: [
            { id: 11, image: 'https://picsum.photos/seed/education1/750/300.jpg', url: '/pages/goods/list?cat=5', title: '教育培训课程' },
            { id: 12, image: 'https://picsum.photos/seed/education2/750/300.jpg', url: '/pages/tuan/activity', title: '开学季特惠' }
        ]
    },
    {
        name: '美容美发',
        id: 6,
        childCats: [{ id: 601, name: '美发', count: 100 }, { id: 602, name: '美甲' }, { id: 603, name: '美容SPA' }],
        where: { cat: 6, type: 0, order: 0 },
        datas: [
            { id: 701, title: '精剪造型套餐', image: 'https://picsum.photos/seed/beauty701/300/300.jpg', price: 88, originalPrice: 128, discount: 6.9, memberBack: 2, promoteReward: 6, store: { name: '时尚美发沙龙' }, count: 289, promotionCount: 156, memberReturn: 20, commissionRate: 5, commissionAmount: 10 },
            { id: 702, title: '美甲美睫套餐', image: 'https://picsum.photos/seed/beauty702/300/300.jpg', price: 168, originalPrice: 238, discount: 7.1, memberBack: 5, promoteReward: 12, store: { name: '指尖艺术' }, count: 213, promotionCount: 102, memberReturn: 20, commissionRate: 5, commissionAmount: 20 },
            { id: 703, title: '全身SPA护理', image: 'https://picsum.photos/seed/beauty703/300/300.jpg', price: 398, originalPrice: 568, discount: 7.0, memberBack: 12, promoteReward: 25, store: { name: '雅致SPA会所' }, count: 156, promotionCount: 78, memberReturn: 20, commissionRate: 5, commissionAmount: 50 }
        ],
        banner: [
            { id: 13, image: 'https://picsum.photos/seed/beauty1/750/300.jpg', url: '/pages/goods/list?cat=6', title: '美丽焕新季' },
            { id: 14, image: 'https://picsum.photos/seed/beauty2/750/300.jpg', url: '/pages/coupon/activity', title: '美容优惠券' }
        ]
    },
    {
        name: '健身运动',
        id: 7,
        childCats: [{ id: 701, name: '健身房', count: 100 }, { id: 702, name: '游泳' }, { id: 703, name: '瑜伽' }],
        where: { cat: 7, type: 0, order: 0 },
        datas: [
            { id: 801, title: '健身月卡', image: 'https://picsum.photos/seed/fitness801/300/300.jpg', price: 299, originalPrice: 468, discount: 6.4, memberBack: 9, promoteReward: 18, store: { name: '力动健身' }, count: 245, promotionCount: 123, memberReturn: 20, commissionRate: 5, commissionAmount: 35 },
            { id: 802, title: '瑜伽课程10节', image: 'https://picsum.photos/seed/fitness802/300/300.jpg', price: 580, originalPrice: 880, discount: 6.6, memberBack: 18, promoteReward: 36, store: { name: '静心瑜伽馆' }, count: 167, promotionCount: 89, memberReturn: 20, commissionRate: 5, commissionAmount: 70 },
            { id: 803, title: '游泳次卡20次', image: 'https://picsum.photos/seed/fitness803/300/300.jpg', price: 380, originalPrice: 580, discount: 6.6, memberBack: 12, promoteReward: 24, store: { name: '阳光游泳馆' }, count: 198, promotionCount: 105, memberReturn: 20, commissionRate: 5, commissionAmount: 45 }
        ],
        banner: [
            { id: 15, image: 'https://picsum.photos/seed/fitness1/750/300.jpg', url: '/pages/goods/list?cat=7', title: '健身特惠' },
            { id: 16, image: 'https://picsum.photos/seed/fitness2/750/300.jpg', url: '/pages/tuan/activity', title: '运动套餐' }
        ]
    }
];
// 模拟请求延迟
const delay = (ms) => new Promise(resolve => setTimeout(resolve, ms));
export const api = {
    async getHome() {
        await delay(300); // 模拟网络延迟
        return {
            code: 0,
            data: mockCategories,
            msg: 'success'
        };
    }
}